package com.webchat.common.constants;


import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashSet;
import java.util.Set;

public class ConnectConstants {



    @Getter
    public enum ClientEnum {

        PC, MOBILE;
    }

    @Getter
    public enum AppEnum {

        WEB, WIN, MAC, IOS, ANDROID;
    }

    @Getter
    @AllArgsConstructor
    public enum BizEnum {

        INDEX("INDEX", "首页"),
        CHAT("CHAT", "对话");

        private String bizCode;
        private String bizName;
    }

    public static class ConnectBiz {

        public static String getBizCode(ClientEnum client, AppEnum app, BizEnum bizEnum){

            return client.name() + "_" + app.name() + "_" + bizEnum.bizCode;
        }

        /**
         * 获取所有端的某个业务场景的bizCode合集
         *
         * @param bizEnum
         * @return
         */
        public static Set<String> getBizCode(BizEnum bizEnum){
            Set<String> bizCodes = new HashSet<>();
            for (ClientEnum client : ClientEnum.values()) {
                for (AppEnum app : AppEnum.values()) {
                    String bizCode = getBizCode(client, app, bizEnum);
                    bizCodes.add(bizCode);
                }
            }
            return bizCodes;
        }
    }
}
